puts "INFO: Running script [info script] @ [exec date]\n"

#########################################
# reset latency
#########################################
set_interactive_constraint_modes [all_constraint_modes -active]
reset_clock_latency [all_clocks]
set_interactive_constraint_modes {}

#########################################
#clock uncertainty
#########################################
set timing_enable_uncertainty_for_clock_checks true 
set_interactive_constraint_modes [all_constraint_modes -active]
#set_clock_uncertainty 0.0 [all_clocks]


#########################################
# CLK NDR rule
#########################################
if {[dbGet -e head.rules.name TrunkNDR] == ""} {
		add_ndr -name TrunkNDR \
		    -width    { ME4 0.4 ME5 0.4} \
			-spacing  { ME4 0.4 ME5 0.4}
}
if {[dbGet -e head.rules.name LeafNDR] == ""} {
		add_ndr -name LeafNDR \
		    -width    {ME2 0.4 ME3 0.4 ME4 0.4} \
			-spacing  {ME2 0.4 ME3 0.4 ME4 0.4}
}

create_route_type -name CTS_NDR_TRUNK_RULE -bottom_preferred_layer ME4 -top_preferred_layer ME5 -preferred_routing_layer_effort high -non_default_rule TrunkNDR
create_route_type -name CTS_NDR_LEAF_RULE -bottom_preferred_layer ME2 -top_preferred_layer ME4 -non_default_rule LeafNDR

set_ccopt_property route_type CTS_NDR_TRUNK_RULE -net_type top
set_ccopt_property route_type CTS_NDR_TRUNK_RULE -net_type trunk
set_ccopt_property route_type CTS_NDR_LEAF_RULE -net_type leaf



#########################################
# ccopt property
#########################################
# CTS Cells
set CTS_BUFFER_CELLS "CKBUFM6HM CKBUFM8HM CKBUFM12HM CKBUFM16HM CKBUFM20HM CKBUFM24HM CKBUFM32HM"
set CTS_INVERTER_CELLS "CKINVM4HM CKINVM6HM CKINVM8HM CKINVM12HM CKINVM16HM CKINVM20HM CKINVM24HM CKINVM32HM"

set_ccopt_property buffer_cells $CTS_BUFFER_CELLS
set_ccopt_property inverter_cells $CTS_INVERTER_CELLS

set_ccopt_property max_fanout 30
set_ccopt_property max_source_to_sink_net_length 150

set_ccopt_property target_max_trans 0.4
set_ccopt_property target_max_trans -net_type leaf 0.4
set_ccopt_property target_max_trans -net_type trunk 0.4

set_ccopt_property target_max_capacitance 0.3
set_ccopt_property target_max_capacitance -net_type leaf 0.3
set_ccopt_property target_max_capacitance -net_type trunk 0.3

set_ccopt_property routing_top_min_fanout 2000

puts "INFO: Completed script [info script]\n"


